package com.ry.demo.register.client;

import com.ry.demo.register.client.dto.HttpSender;

import java.util.UUID;

/**
 * @Author: lihui
 * @Date: 2021-12-01 10:49
 * @Description:
 */
public class RegisterClient {

    /**
     * 服务实例id
     */
    private String serviceInstanceId;

    /**
     * http请求组件
     */
    private HttpSender httpSender;

    public RegisterClient() {
        this.serviceInstanceId = UUID.randomUUID().toString().replace("-", "");
        this.httpSender = new HttpSender();
    }


    public void start(){

        // 启动一个工作线程 去执行服务实例注册
        new Thread(new RegisterClientWorker(serviceInstanceId,httpSender)).start();


    }

}
